package com.utn.tp.integrador.activities;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

import com.utn.tp.integrador.R;
import com.utn.tp.integrador.bd.BaseDatos;

public class DetalleAccion extends Activity {

	private Bundle bun;
	private int id;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.detallesregistro);
		TextView tvDetalle = (TextView) findViewById(R.id.lblDetalle);
		// EditText etDetalle = (EditText) findViewById(R.id.txtDetalle);
		bun = getIntent().getExtras();
		id = bun.getInt("AccionID");

		tvDetalle.setText(cargarDetalle(id));

		setTitle("Detalle de la Accion");
		// etDetalle.setText(cargarDetalle(id));
	}

	private String cargarDetalle(int id_acc) {
		BaseDatos db = getBaseDatos();
		if (db != null) {
			return db.getDetalleRegistro(id_acc);
		} else
			return null;
	}

	private BaseDatos getBaseDatos() {
		return new BaseDatos(this);
	}
}
